{include file="common/_header"}

<body>

<div class="x-body layui-anim layui-anim-up">
    <form  action="boxvideo" enctype="multipart/form-data" method="post">

        <input type="hidden" name="id" value="{$data.video_id}">

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">视频名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" autocomplete="off" class="layui-input" value="{$data.data.name}" lay-verify="required" placeholder="请输入视频名称">
                </div>
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">排序</label>
                <div class="layui-input-inline">
                    <input type="text" name="sort" autocomplete="off" value="{$data.data.sort}" class="layui-input" placeholder="请输入数字">
                </div>
            </div>
        </div>

        {if !$data.video_id}
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">视频文件</label>
                <div class="layui-input-inline">
                    <input type="file" name="image" accept=".mp4"/>
<!--                    <input type="file" name="file" autocomplete="off" accept=".mp4" class="layui-icon-file">-->
                </div>
            </div>
        </div>
        {/if}




        <div style="margin-top: 50px; float: right; margin-right: 50px;">
            <button type="submit"  class="layui-btn">立即提交</button>
        </div>
    </form>
</div>
</body>

<script>
    // layui.use(['layedit', 'form'], function () {
    //
    //     var form = layui.form;
    //
    //     form.on('submit(add)', function (data) {
    //
    //         // data.field.detail = layui.layedit.getContent(index);
    //         console.log(data.field);
    //         $.ajax({
    //             'url': '/website/boxvideo',
    //             'type': 'post',
    //             'data': data.field,
    //             'dataType': 'json',
    //             success: function (data) {
    //                 console.log(data);
    //                 if (data.code == 1) {
    //                     layer.msg(data.msg, {
    //                         icon: 6,
    //                         time: 800,
    //                     }, function () {
    //                         window.parent.location.href = data.url;
    //                     })
    //                 } else if (data.code == 0) {
    //                     layer.msg(data.msg);
    //                 }
    //             }
    //         });
    //     });
    //
    // });


</script>

{include file="common/_bottom"}